<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ page import="java.util.Calendar"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Discussion Board</title>
<meta name="keywords" content="free css website template, gift red, christmas, 3-column layout, CSS, HTML" />
<meta name="description" content="Gift Red is free website template by templatemo.com" />
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script type='text/javascript' src='js/logging.js'></script>
<script type="text/javascript">
	$(function() {
		$("#register").click(function(){
			location.href="registerView.do";
		});
		
		
		$("#login").click(function(){
			if($("#id").val().length==0){
				alert("아이디를 입력하세요!");
				return;
			}else if($("#password").val().length==0){
				alert("비밀번호를 입력하세요!");
				return;
			}
			$("#loginForm").submit();
		}); 
		
		$("#logoutBtn").click(function(){
			location.href="logout.do";
		});
		
		$("#myPage").click(function(){
			location.href="myPage.do?id=${sessionScope.mvo.id}";
		});
		
		///////////////////////////////////////////////////
		
		<%-- 글쓰기 버튼 --%>
		$("#writeBtn").click(function(){
			location.href="${initParam.root}/board_goDisWrite.do";
		});
		$("#writeFileBtn").click(function() {
			//alert("ddd");
			location.href = "${initParam.root}/board_goInsertFileBoard.do";
		});
		var table1 = $("table").ariaSorTable({
			rowsToShow : 10,
			pager : true,
			onInit : function() {
				demoControl();
			},
			colsToHide : {
				1 : true,
				7 : true
			}
		});
		$("#destroy").click(function(event) {
			table1.ariaSorTable('destroy');
		});
		$("#disable").click(function(event) {
			table1.ariaSorTable('disable');
		});

		// add themeswitcher
		var ts = $(
				'<div class="ui-button ui-widget ui-state-default ui-corner-all" style="font-size: 0.7em; padding: 5px; position: absolute; top: 20px; right: 10px;">Click here to add Themeswitcher!</div>')
				.appendTo('body')
				.bind(
						"click",
						function() {
							ts.text("Loading Themeswitcher...");
							$
									.getScript(
											'http://ui.jquery.com/applications/themeroller/themeswitchertool/',
											function() {
												ts
														.removeClass(
																"ui-button ui-widget ui-state-default ui-corner-all")
														.text("").unbind(
																"click")
														.themeswitcher();
											});
						});
	});
</script>
<link href="${initParam.root}/css/style.css" rel="stylesheet" />
</head>
<body>

<div id="templatemo_wrapper">
	
    <!-- <div id="templatemo_header"> -->
    	<div id="site_title"><h1></h1></div>
    	
        <div id="templatemo_menu">
         
            <ul>
              <li><a href="home.do" class="current home">Home</a></li>
              <li><a href="myPage.do">MyPage</a></li>
              <li><a href="ttboard.do">Tech & Tip</a></li>
              <li><a href="news.do">News</a></li>
              <li><a href="qnA.do">QnA</a></li>
              <li ><a href="discussion.do">Discussion</a></li>
              <li ><a href="download.do">Download</a></li>
            </ul>
        </div> <!-- end of templatemo_menu -->   
        
    <!-- </div> end of header -->
    <br><br>
    <div id="templatemo_left_sidebar">
    	<div class="sb_box">
          <div class="content_title"><span></span>Java Box!</div>
				<c:choose>
				<c:when test="${sessionScope.mvo==null }">
				<form action="login.do" method="post" id="loginForm">
				 <input type="text" id="id" name="id" placeholder="ID"><br>
				 <input type="password" id="password" name="password" placeholder="PassWord"><br>
				<input type="button" id="register" value="회원가입">
				<input type="button" id="login" value="로그인"><br><br>
				</form>
				</c:when>
				<c:otherwise>
				ID : ${sessionScope.mvo.id}<br>
				Name : ${sessionScope.mvo.name}<br>
				Point : ${sessionScope.mvo.point}<br>
				Grade : ${sessionScope.mvo.grade}<br>
				<input type="button" value="로그아웃" id="logoutBtn">
				<input type="button" value="마이페이지" id="myPage">
				</c:otherwise>
				</c:choose>
            <ul class="tmo_list">
                <li><a href="#">Praesent pretium ligula</a></li>
                <li><a href="#">Fusce at massa mollis</a></li>
            </ul>
		</div>        
        <a href="#" class="sb_ads"><img src="images/templatemo_ad_1.jpg" alt="image 1" /></a>
        <a href="#" class="sb_ads"><img src="images/templatemo_ad_2.jpg" alt="image 2" /></a>
    
    </div> <!-- end of left sidebar -->
<!-- start of view page -->
     
 <center>
<h2>관리자 토론게시판 관리 페이지</h2>
		<table>
				<thead>
					<tr>
						<th
							class="ui-table-asc ui-state-active ui-table-number ui-state-default"
							style="width: 10em;"><a href="#server_site_order">NO</a></th>
						<th class="ui-table-number ui-state-default"
							style="min-width: 10em;"><a href="#server_site_order">토론주제</a></th>
						<th class="ui-table-number-de ui-state-default"
							style="width: 5em;">수정</th>
						<th class="ui-table-number ui-state-default" style="width: 5em;" a><a
							href="#server_site_order">삭제</a></th>
					</tr>
				</thead>
			<tbody>
				<c:forEach items="${requestScope.list }" var="list">
					<tr>
						<td>${list.disNo }</td>
						<td>${list.disContent}</td>
						<td><a href="${initParam.root}/board_goDisUpdate.do?disNo=${list.disNo }">수정</a></td>
						<td><a href="${initParam.root}/board_goDisDelete.do?disNo=${list.disNo }">삭제</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	<input type="button" id="writeBtn" value="글쓰기">
</center>
 
<!-- end of view page -->
<div id="templatemo_footer_wrapper">
    <div id="templatemo_footer">
        Copyright © 2072 <a href="#">Your Company Name</a> | <a rel="nofollow" href="http://www.templatemo.com/preview/templatemo_362_gift_red">Gift Red</a> by <a href="http://www.templatemo.com" rel="nofollow" target="_parent" title="free css templates">templatemo</a>
        <div class="cleaner"></div>
    </div>
</div>
</div>

</body>
</html>